﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using MyLib.Utils;
using MyLib.Integration;

namespace WebPortal
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {

        }

        protected void Session_Start(object sender, EventArgs e)
        {
            //User u = new User();
            //u.UserAccount = HttpContext.Current.User.Identity.Name;

            //SSOUtil.LoginedUser = u;
        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {            
            Exception objErr = Server.GetLastError().GetBaseException();
            LogUtil.Error(objErr);
            if (HttpContext.Current.Session != null)
            {
                HttpContext.Current.Session["Exception"] = objErr;
                Server.Transfer("\\Error.aspx");
            }
        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}